package com.zxy.ziems.server.device.pojo.dto;

import com.zxy.ziems.server.device.pojo.bo.Coordinate;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Null;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 设备抽象
 * @author chdzq
 * @create 2023/3/22
 */
@Data
public class DeviceDTO<T> {
    /**
     * 主键
     */
    @Null(message = "新增设备，ID必须为空", groups = Add.class)
    @NotBlank(message = "设备ID不能为空", groups = {Update.class, Select.class})
    private String id;

    /**
     * 设备的编码
     */
    @NotBlank(message = "设备编码不能为空", groups = {Update.class, Add.class})
    private String code;

    /**
     * 设备名称
     */
    @NotBlank(message = "设备名称不能为空", groups = {Update.class, Add.class})
    private String name;

    /**
     * 设备类型的Code
     */
    @NotBlank(message = "设备类型不能为空", groups = {Update.class, Add.class})
    private String type;

    /**
     * 场景ID
     */
    @NotBlank(message = "设备厂商ID不能为空", groups = {Update.class})
    private String sceneId;

    /**
     * 部门ID
     */
    @NotBlank(message = "部门ID不能为空", groups = {Update.class})
    private String orgId;

    /**
     * 坐标, z默认给0
     */
    private Coordinate coordinate;

    /**
     * 额外信息，比如物资的特有属性就放在这里的
     */
    private T extra;

    public interface Add{}
    public interface Update{}
    public interface Select {}

}
